const utils = require('./utils')
const MS = global.MS || {}
MS.utils = utils
MS._config = utils.getConfig()
MS.type = 'nodejs'
MS.initialize = (applicationId, applicationKey, appid, mAppId) => {
    MS._config.applicationId = applicationId
    MS._config.applicationKey = applicationKey
    MS._config.appid = appid
    MS._config.mAppId = mAppId
}
MS.currentAppId = () => {
    return MS._config.appid;
}
MS.getHeader = () => {
    let header = {
        'X-MS-ApplicationId': MS._config.applicationId,
        'X-MS-REST-API-KEY': MS._config.applicationKey,
        'X-MS-APP-ID': MS._config.appid
    }
    return header
}
// MS.WXInit = (applicationId, applicationKey, appid) => {
//     MS.type = 'wx'
//     MS.initialize(applicationId, applicationKey, appid)
// }
// MS.WebInit = (applicationId, applicationKey, appid) => {
//     MS.type = 'h5'
//     MS.initialize(applicationId, applicationKey, appid)
// }
// MS.NodeInit = (applicationId, applicationKey, appid) => {
//     MS.type = 'nodejs'
//     MS.initialize(applicationId, applicationKey, appid)
// }
// MS.HapInit = (applicationId, applicationKey, appid) => {
//     MS.type = 'hap'
//     MS.initialize(applicationId, applicationKey, appid)
// }
module.exports = MS